package advice;

import org.springframework.aop.ThrowsAdvice;

import java.lang.reflect.Method;
import java.util.Arrays;

public class ExceptionService implements ThrowsAdvice {
    public void afterThrowing(Method method,Object[] args,
                              Object target, Exception ex) throws Throwable {
        System.out.println("===================异常增强start====================");
        System.out.println(target+"的"+method.getName()+"方法被执行了，参数是："+
                Arrays.toString(args)+",发生了异常："+ex.getMessage());
        System.out.println("===================异常增强end====================");
    }
}
